package com.chinatelecom.telecollege.sellerrewarding.controller;

import com.chinatelecom.telecollege.sellerrewarding.Entity.crmorder;
import com.chinatelecom.telecollege.sellerrewarding.service.crmorderService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
/**
 * Created by lenovo on 2017/6/21.
 */
@RestController
public class crmorderController {
    @Autowired
    private crmorderService crmorderService;

    @RequestMapping(value = "/crmorder")
    public crmorder querycrmorder(@RequestParam int id) {
        return crmorderService.findByid(id);
    }

    @RequestMapping(value = "/crmorderall")
    public List<crmorder> querycrmorderall() {
        return crmorderService.findAll();
    }
    @RequestMapping(value = "/crmorderbyseller")
    public List<crmorder> querycrmorderbyseller(@RequestParam String id) {
        return crmorderService.findByseller(id);
    }
    @RequestMapping(value = "/crmorderbyarea")
    public List<crmorder> querycrmorderbyarea(@RequestParam int id) {
        return crmorderService.findByarea(id);
    }
    @RequestMapping(value = "/crmorderbyservicehall")
    public List<crmorder> querycrmorderbyservicehall(@RequestParam int id) {
        return crmorderService.findByservicehall(id);
    }
}
